﻿using System;

namespace CalculatorApi.Core.Services
{
    public class CalculatorService : ICalculatorService
    {
        private decimal _total;

        public CalculatorService()
        { }

        public CalculatorService(decimal startingValue)
        {
            _total = startingValue;
        }

        public void Add(decimal number)
        {
            _total += number;
        }

        public decimal Result()
        {
            return _total;
        }

        public void Subtract(decimal p0)
        {
            _total -= p0;
        }

        public void Multiply(decimal p0)
        {
            _total *= p0;
        }

        public void Divide(decimal p0)
        {
            _total /= p0;
        }
    }
}
